﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DLL.Entities;
using System.Xml.Serialization;
using System.Xml; 

namespace COM
{
    public partial class COM_Form : Form
    {
        Radar RAD = new Radar(); 

        public COM_Form()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                XmlReader reader2 = new XmlTextReader("../../../Radar.xml");
                XmlSerializer serializer2 = new XmlSerializer(typeof(Radar));
                RAD = (Radar)serializer2.Deserialize(reader2);
                reader2.Close();
                txtSpeed.Text = Convert.ToString(RAD.Speed);
                txtDistance.Text = Convert.ToString(RAD.Distance);
                txtAltitude.Text = Convert.ToString(RAD.Altitude);
                txtDirection.Text = Convert.ToString(RAD.Direction);
            }
            catch (Exception ex)
            {
            }
        }

        private void COM_Form_Load(object sender, EventArgs e)
        {
            
        }
    }
}
